import config from "@/config"
import http from "@/utils/request"
export default {
	list: {
		url: `${config.API_URL}/sysfile/directory`,
		name: "列表",
		get: async function(params){
			return await http.get(this.url,params);
		}
	},
	files: {
		url: `${config.API_URL}/sysfile/files`,
		name: "查询文件列表",
		get: async function(params){
			return await http.get(this.url,params);
		}
	},
	upload: {
		url: `${config.API_URL}/sysfile/upload`,
		name: "文件上传",
		post: async function(data, path){
			return await http.post(this.url+'?path='+path, data);
		}
	},
	delFile: {
		url: `${config.API_URL}/sysfile/file`,
		name: "删除文件",
		delete: async function(params){
			return await http.delete(this.url+'?path='+params);
		}
	},
    delDirectory: {
		url: `${config.API_URL}/sysfile/directory`,
		name: "删除目录",
		delete: async function(params){
			return await http.delete(this.url+'?path='+params);
		}
	},
    adv: {
		url: `${config.API_URL}/sysfile/upload`,
		name: "上传广告位",
		post: async function(data){
			return await http.post(this.url+'?path=/upload/adv/',data);
		}
	},
    avatar: {
		url: `${config.API_URL}/sysfile/upload`,
		name: "上传头像",
		post: async function(data){
			return await http.post(this.url+'?path=/upload/avatar/',data);
		}
	},
	artice: {
		url: `${config.API_URL}/sysfile/upload`,
		name: "上传文章图片",
		post: async function(data){
			return await http.post(this.url+'?path=/upload/artice/',data);
		}
	},
}


